<?php include_once 'Pecahan/sessionLontong.php'; ?>
<?php
if (isset($_GET['name_viewed'])!= NULL) {
    $name_viewed = $_GET['name_viewed'];
}
else if (isset($_SESSION['user_name'])!= NULL) {
    $name_viewed = $_SESSION['user_name'];
}
if (isset($_SESSION['user_name'])!= NULL) {
    $name_logon = $_SESSION['user_name'];
    $temp = new login();
    $role = $temp->getRole($name_logon );
}
else {
    $name_logon = NULL;
    $role = NULL;
}
?>
<?php
include_once'controller/registrasi.php';
include_once'controller/login.php';
include_once 'controller/follow.php';
?>
<?php $judul = 'Edit Profile'; ?>
<?php include_once 'Pecahan/header.php'; ?>

<div id ="content" class="isipage">
    <div class="isipagekiri">
        <div>
        </div>
    </div>
    <div class="isipagetengah">
        <div class="registrasi">
            <h3>Edit Profile</h3>
            <?php
            $prof = new login();
            ?>
            <form class="formLayout" action="profil.php" method="post" enctype="multipart/form-data">
                <div>
                    <label class="labelinput">Nama</label>
                    <input class="input" type="text" name="nama" id="nama" value="<?php echo $prof->getFullName($_SESSION['user_name']);?>" onblur="cekNama(this.value);"/>
                    <div id="cek_nama" class="keterangan"><br/>
                    </div>
                </div>
                <div>
                    <label class="labelinput">Tanggal Lahir</label>
                    <input class="input" type="text"  name="tanggalLahir" id="tanggalLahir" value="<?php echo $prof->getBirthday($_SESSION['user_name']);?>" onblur="cekTanggal(this.value)"/>
                    <div id="cek_tanggalLahir" class="keterangan"><br/>
                    </div>
                </div>
                <div>
                    <label class="labelinput">Email</label>
                    <input class="input" type="text" name="email" id="email" value="<?php echo $prof->getEmail($_SESSION['user_name']);?>" onblur="cekEmail(this.value)"/>
                    <div id="cek_email" class="keterangan"><br/>
                    </div>
                </div>
                <div>
                    <label class="labelinput">Jenis kelamin</label>
                    <select class="input" id="jeniskelamin" name="jenisKelamin">
                        <option value="pria" <?php if ($prof->getGender($_SESSION['user_name']) == "pria") {
                            echo "selected";
                                }?> >Pria</option>
                        <option value="wanita" <?php if ($prof->getGender($_SESSION['user_name']) == "wanita") {
                            echo "selected";
                                }?> >Wanita</option>
                    </select>
                    <div>
                        <br/>
                    </div>
                </div>
                <div>
                    <label  class="labelinput" id="penglihat_label">Wall Privacy</label>
                    <select class="input" id="selectinput" name="wallprivacy">
                        <option value="all_user">All Users</option>
                        <option value="follower_user">Only Follower</option>
                        <option value="owner">Only Owner</option>
                    </select>
                    <div class="space"></div>
                </div>
                <div>
                    <label class="labelinput">Lokasi</label>
                    <input class="input" type="text" name="lokasi" id="lokasi" value="<?php echo $prof->getLocation($_SESSION['user_name']);?>" onblur="cekLokasi(this.value);"/>
                    <div id="cek_lokasi" class="keterangan"> <br/>
                    </div>
                </div>
                <div>
                    <br/>
                </div>
                <div>
                    <input id="reset" type="reset" value="Reset" />
                    <input id="submit" name="submitButtonEditProfile" type="submit" value="Save" />
                </div>
            </form>
        </div>
    </div>
    <div class="isipagekanan">
        <div class="registrasi2">
            <h3>Change Password</h3>
            <form class="formLayout2" action="profil.php" method="post">
                <div>
                    <label class="labelinput">Password</label>
                    <input class="input" type="password" name="password" id="password" onblur="cekPassword(this.value);"/>
                    <div id="cek_password" class="keterangan"><br/>
                    </div>
                </div>
                <div>
                    <label class="labelinput">Re Password</label>
                    <input class="input" type="password" name="rePassword" id="rePassword" onblur="cekRePassword(this.value);"/>
                    <div id="cek_rePassword" class="keterangan"><br/>
                    </div>
                </div>
                <div>
                    <br/>
                </div>
                <div>
                    <input id="reset" type="reset" value="Reset" />
                    <input id="submit" name="submitButtonEditPassword" type="submit" value="Save" />
                </div>
            </form>
        </div>
    </div>
</div>
<?php include_once 'Chat/chat.php';?>
<?php include_once 'Pecahan/footer.php'; ?>
